package com.itheima.annotation2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements UserService {
	// 声明UserDao属性
	//@Resource(name = "userDao")
	@Autowired
	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	// 实现的接口中方法
	public void say() {
		//调用userDao中的say()方法，并执行输出语句
		this.userDao.say();
		System.out.println("userService say hello World !");
	}
}
